package com.sixth.dao;

import com.sixth.entity.Inventory;
import com.sixth.entity.InventoryGoods;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface InventoryDao {
    int deleteByPrimaryKey(Integer invenid);

    int insert(Inventory record);

    int insertSelective(Inventory record);

    Inventory selectByPrimaryKey(Integer invenid);

    int updateByPrimaryKeySelective(Inventory record);

    int updateByPrimaryKey(Inventory record);

    //查询盘点审核表信息
    List<Inventory> getAllInventory(Integer branchid);

    //根据当前盘点编号获取到报损详情表内相应的信息
    List<Map> getInventoryGoods(@Param("invenid") Integer invenid);

    //存储审核的报损信息到inventory_goods表中
    //Integer addInventoryGoods(InventoryGoods ig);


    List<Inventory> selectInventoryByBranchid(Integer branchid);

    //审核通过后，往盘点信息表内修改进审核人和审核信息
    Integer updateInventoryExPass(@Param("invenid") Integer invenid, @Param("examtime") Date examtime, @Param("examstaffid") Integer staffid);

    //根据盘点编号查询盘点表单
    List<InventoryGoods> getInventoryByInvenid(Integer invenid);

    //审核驳回后，往盘点信息表内修改进审核人和审核信息
    Integer updateInventoryExReject(@Param("invenid") Integer invenid, @Param("examtime") Date examtime, @Param("examstaffid") Integer staffid, @Param("remarks") String remarks);

    //添加到盘点审核表
    Integer addInventoryOne(@Param("dates") String dates, @Param("staffid")Integer staffid, @Param("branchid")Integer branchid);

    //根据时间查询inventory的对象
    Inventory selectInvenidByDate(@Param("data")String date);

    //存储审核的报损信息到inventory_goods表中
    Integer addInventoryGoods(@Param("invenid") Integer invenid,@Param("goodsid") Integer goodsid, @Param("panDianNum")Integer panDianNum,@Param("baoSunNum") Integer baoSunNum);
    //根据branchid，时间动态查询
    List<Inventory> getAllFrmLoss(@Param("branchid") Integer branchid, @Param("starttime")String starttime,@Param("endtime") String endtime, @Param("bfbranchid")Integer bfbranchid,  @Param("roleid")Integer roleid);

}
